package org.hako.recite.word.input;

/**
 * Sokuon prefix matcher.
 * 
 * @since 0.4.4
 * @author <a href="mailto:xnnyygn@gmail.com">xnnyygn</a>
 */
public class SokuonPrefixMatcher implements PrefixMatcher {

	@Override
	public boolean check(String roma, int index, int length) {
		int remaing = length - index;
		if (remaing < 2) {
			return false;
		}
		return roma.charAt(index) == roma.charAt(index + 1);
	}

	@Override
	public String match(String roma, int index) {
		return "っ";
	}

	@Override
	public int getStepLength() {
		return 1;
	}

}
